//
//  eatingbox.m
//  shuilijuOASystem
//
//  Created by michael on 16/8/15.
//  Copyright © 2016年 czd. All rights reserved.
//
#import "fanweibox.h"
@interface fanweibox ()
@property(nonatomic,strong)UIButton * selectedButton;
@property (weak, nonatomic) IBOutlet UIButton *noOrder;

@end

@implementation fanweibox
- (IBAction)didCheckBox:(id)sender {
    UIButton * btn = (UIButton*)sender;
    self.selectedButton.selected = NO;
    btn.selected = YES;
    self.selectedButton = btn;
    self.orderString = [NSString stringWithFormat:@"%ld",(long)btn.tag];
    if (self.selectRowBlock) {
       self.selectRowBlock(self.orderString);
    }
}

-(void)awakeFromNib{
[_mianyibutton setTitle:NSLocalizedString(@"添加商品-价格面议", nil) forState:UIControlStateNormal];
[_zidingyibutton setTitle:NSLocalizedString(@"添加商品-自定义价格区间", nil) forState:UIControlStateNormal];
    self.autoresizingMask = UIViewAutoresizingNone;
    if ([[NSString stringWithFormat:@"%ld",(long)_seltag]isEqualToString:@"0"]) {
        [self didCheckBox:self.noOrder];

}else{
  UIButton *button = (UIButton *)[self viewWithTag:_seltag];
    [self didCheckBox:button];
  }
    

   
}
- (void)setSeltag:(NSInteger)seltag
{
_seltag = seltag;
_orderString = [NSString stringWithFormat:@"%ld",(long)_seltag];
[self awakeFromNib];
}
+(instancetype)checkBoxFootView{
    return [[[NSBundle mainBundle] loadNibNamed:@"fanweibox" owner:nil options:nil] lastObject];
}
@end
